package com.shrct.businessprocess.project.impl;

import com.shrct.businessprocess.project.RCCommissionYearConfig;
import com.shrct.businessprocess.project.RCCommissionYearConfigDAO;
import com.shrct.businessprocess.project.events.RCCommissionYearConfigEventsManager;
import com.shrct.businessprocess.project.impl.RCCommissionYearConfigImpl;
import edu.fudan.mylang.pf.BaseDAOService;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.project.RCCommissionYearConfigDAO")
public class RCCommissionYearConfigDAOImpl extends BaseDAOService<RCCommissionYearConfig> implements RCCommissionYearConfigDAO {
  @Autowired
  private RCCommissionYearConfigEventsManager eventsManager;
  
  public RCCommissionYearConfig create(final Procedure1<? super RCCommissionYearConfig> init) {RCCommissionYearConfig rCCommissionYearConfig=RCCommissionYearConfigImpl.create(getObjectFactory());
    final Procedure1<RCCommissionYearConfig> _function = new Procedure1<RCCommissionYearConfig>() {
        public void apply(final RCCommissionYearConfig it) {
          init.apply(it);
          it.checkValid();
          RCCommissionYearConfigDAOImpl.this.eventsManager.fireCreated(it);
        }
      };
    RCCommissionYearConfig _doubleArrow = ObjectExtensions.<RCCommissionYearConfig>operator_doubleArrow(rCCommissionYearConfig, _function);
    return _doubleArrow;
  }
  
  public void delete(final RCCommissionYearConfig value) {getObjectFactory().delete(value);
    
    this.eventsManager.fireDeleted(value);
  }
}
